package edu.java.texbooks.scjp.threads.test17;

//import java.util.Random;

public class MyRunnable implements Runnable {

	@Override
	public void run() {
		System.out.println(Thread.currentThread().getName() + " starts...");
		// int sleepTime = new Random().nextInt(500);
		int sleepTime = 10000;
		System.out.println(Thread.currentThread().getName()
				+ " goes to sleep for " + sleepTime + " milliseconds.");
		try {
			Thread.sleep(sleepTime);
		} catch (InterruptedException e) {
			System.out.println("Interrupted Exception in "
					+ Thread.currentThread().getName());
			e.printStackTrace();
		}
		System.out.println(Thread.currentThread().getName() + " ends.....");
	}
}
